package pers.xuyong.code.lang.thread;

/**
 * 测试线程
 *
 * @author billymac
 * @version 1.0
 * @date 17/7/13  上午9:30
 * @since JDK1.8
 */
public class MyThread extends Thread {

    @Override
    public void run() {
        for (int i = 0; i < 3; i++) {
            System.out.println(Thread.currentThread().getName() + " : " + this.getNextNum());
        }
    }

    public Integer getNextNum() {
        Context.threadLocal.set(Context.threadLocal.get() + 1);
        return Context.threadLocal.get();
    }
}
